package com.miyake.dsp.convolution;

import com.miyake.dsp.ComplexArray;
import com.miyake.dsp.Processor;
import com.miyake.dsp.ScilabExecute;

public class ConvolutionImplScilab implements Processor {

	private ComplexArray source;
	private ConvolutionSetting setting;

	public ConvolutionImplScilab(ConvolutionSetting setting) {
		this.setting = setting;
	}
	
	@Override
	public void setSource(ComplexArray source) {
		this.source = source;
	}

	@Override
	public ComplexArray getProcessed() {
		return ScilabExecute.execute("y=convol(data1, data2);", source, setting.getEndPoint().getProcessor().getProcessed(), "y");
	}

	@Override
	public ComplexArray getSource() {
		return this.source;
	}

	@Override
	public Object getSetting() {
		return setting;
	}

}
